package ZRH;

public class zrh04 {
    public static void main(String[] args) {
        System.out.println(getCount(1, 100));
        System.out.println(getCount(100, 1));
    }

    public static int getCount(int m, int n) {
        //定义计数器
        int count = 0;
        if (m < n) {
            for (int i = m; i <= n; i++) {
                if (i % 3 != 0) {
                    count++;
                }
            }
        } else if (m > n) {
            for (int i = n; i <= m; i++) {
                if (i % 3 != 0) {
                    count++;
                }
            }
        }
        return count;
    }
}
